package cassys.actions.moduleManagement;

import cassys.ejb.clients.ModuleManagementDelegate;
import com.opensymphony.xwork2.ActionSupport;
import cassys.domain.classManagement.*;
import java.util.List;

/**
 *
 * @author User
 */
public class ListModules extends ActionSupport {

    private ModuleManagementDelegate moduleDelegate;
    private List<Module> moduleList;

    public ListModules() {
        moduleDelegate = new ModuleManagementDelegate();
    }

    @Override
    public String execute() throws Exception {
        System.out.println("Listing modules");
        this.moduleList = moduleDelegate.getAllModules();
        System.out.println("got the modules");
        return SUCCESS;
    }

    public List<Module> getModuleList() {
        return moduleList;
    }
}
